package ren.kane.asdppp.activeobject;

import java.util.LinkedList;

/**
 * @author renrk(1275) on 2019-04-22 3:05 PM
 **/
public class ActiveObjectEngine {

    private LinkedList<Command> commands = new LinkedList<>();

    public void addCommand(Command command) {
        commands.add(command);
    }

    public void run() throws Exception {
        while (!commands.isEmpty()) {
            Command command = commands.getFirst();
            commands.removeFirst();
            command.execute();
        }
    }
}
